<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<!DOCTYPE html>
<html>
<head>
    <title>账户信息</title>
    <%@ include file="/WEB-INF/component/commonCSS.jsp"%>
    <style type="text/css">
        div.group-info {
            margin-top: 10px !important;
            margin-bottom: 0px !important;
        }
        input.innerInput {
            width: 98%;
        }
    </style>
</head>
<body class="skin-blue sidebar-mini fixed skin-blue-light-frame">
    <section class="content-header">
        <h1>银行账户信息查看</h1>
        <ol class="breadcrumb">
            <li><a href="${ctx}/home.jsp"><i class="fa fa-home"></i>首页</a></li>
            <li class="active"><a href="#">账户管理</a></li>
            <li class="active"><a href="#">银行账户信息查看</a></li>
        </ol>
     </section>
     
     
     <section class="content" style="min-height:inherit;">
          <form id="form" class="form-horizontal"  method="post">
            <input type="hidden" name=orgId value="${acctInfo.orgId}" />
            
	        <div class="box box-success" style="margin-bottom: 0px;padding-bottom: 10px;">
	           <div class="form-group form-group-xs group-info">
	                 <label for="inputTextAlter1" class="col-sm-2 text-right">机构编号：</label>
	                 <div class="col-sm-4 text-left" >${acctInfo.orgCode}</div>
	                 <label for="inputTextAlter2" class="col-sm-2 text-right">机构名称：</label>
	                 <div id="orgName" class="col-sm-4 text-left">${acctInfo.orgName}</div>
	            </div>
	             
	            <div class="form-group form-group-xs group-info">
                     <label for="inputTextAlter1" class="col-sm-2 text-right">机构类型：</label>
                     <div id="orgType" class="col-sm-4 text-left">${acctInfo.orgType}</div>
                     <label for="inputTextAlter2" class="col-sm-2 text-right">余额：</label>
                     <div id="outstandAmt" class="col-sm-4 text-left">${acctInfo.outstandAmtStr}</div>
                </div>
                
                <div class="form-group form-group-xs group-info">
                     <label for="inputTextAlter1" class="col-sm-2 text-right">可用余额：</label>
                     <div id="availableAmt" class="col-sm-4 text-left">${acctInfo.availableAmtStr}</div>
                     <label for="inputTextAlter2" class="col-sm-2 text-right">待结算余额：</label>
                     <div id="pendingAmt" class="col-sm-4 text-left">${acctInfo.pendingAmtStr}</div>
                </div> 
                
	        </div>
        </form>
     </section>
        
    
    
    <section class="content">
        <div class=" box box-primary">
            <div class="box-body">
                <div class=" form-inline">
        
			       <div class="form-group form-group-xs">
			                                 银行账号： <input class="form-control" type="text" id="bankAcctNo" name="bankAcctNo" placeholder="银行账号" />
			       </div>
			       <div class="form-group form-group-xs">
			                                开户人： <input class="form-control" type="text" id="acctHolder"  name="acctHolder" placeholder="开户人" />
			       </div>
			        <div class="form-group form-group-xs">
			                                 开户行： <input class="form-control" type="text" id="depositBankNo" name="depositBankNo" placeholder="开户行" />
			       </div>
			       <div class="form-group form-group-xs">
			                                 开户行行名： <input class="form-control" type="text" id="depositBankName" name="depositBankName" placeholder="开户行行名" />
			       </div>
                    
                   <button type="button" onclick="gridSerch();" class="btn btn-success btn-sm">查询</button>
                    
                </div>
            </div>
        </div>
        
        <table class="jqgrid" id="gridlist"></table>
        <div id="gridpage"></div>
        
         <div class=" box box-warning bottongroup">
            <label id="add" onclick="add()" class="btn btn-default btn-sm">新 增</label>
            <a href="${ctx}/orderDispatch/toOrderDispatch.html" class="btn btn-default btn-sm">返  回</a>
        </div>
        
        <form action="${ctx}/acctInfoHosp/toAcctInfoHospAdd.html" method="post" id="BankForm">
       	 	<input type="hidden" id="bankAcctId" name="bankAcctId">
        </form>
   </section>
    
   <%@ include file="/WEB-INF/component/commonJS.jsp"%>
   <script type="text/javascript">
		$(function() {
			$("#gridlist").jqGrid(
			{   url : "getBankAcctInfoHospData.html",
				mtype : "POST",
				datatype : "json",
				autowidth : true,
				shrinkToFit : false,
				height : 255,
				colNames : [ '银行账号id','账户id','银行账号','开户人 ','开户行 ','开户行行号 ','开户行行名','提交时间 ','提交人 ','审核状态 ','审核时间 ','审核人','审核备注','是否默认','操作 '],
				colModel : [
							{name : 'bankAcctId',index : 'bankAcctId', hidden : true,width : 100,align : "center"},
                                  {name : 'settleAcctId',index : 'settleAcctId',hidden : true , width : 100,align : "center"},
				            {name : 'bankAcctNo',index : 'bankAcctNo',width : 200,align : "center"},	
							{name : 'acctHolder',index : 'acctHolder',width : 80,align : "center"}, 
							{name : 'depositBank',index : 'depositBank',width : 120,align : "center"},
							{name : 'depositBankNo',index : 'depositBankNo',width : 120,align : "center"},
							{name : 'depositBankName',index : 'depositBankName',width : 200,align : "center",summaryType : 'sum'},
							{name : 'submitDatetimeStr',index : 'submitDatetime',width : 140,align : "center"},
							{name : 'submitUser',index : 'submitUser',width : 80,align : "center"},
							{name : 'auditStatus',index : 'auditStatus',width : 60,align : "center",
							formatter:function(val, opts,
									rowdata) {
								var str ="";
								if(rowdata.auditStatus == 1){
									str="通过";
								}else{
									str="未通过";
								}
							 	return str
                    		}
						},
							{name : 'auditTimeStr',index : 'auditTime',width : 140,align : "center"},
							{name : 'auditUser',index : 'auditUser',width : 80,align : "center"}, 
							{name : 'auditFemark',index : 'auditFemark',width : 80,align : "center"},
							{name : 'isDefaultAcct',index : 'isDefaultAcct',hidden:true,width : 100,align : "center"},
							{name : 'order',index : 'order',width : 120,align : "center",
								formatter:function(val, opts,
										rowdata) {
									var str ="";
									if(rowdata.isDefaultAcct != 1){
										str="<a href='javaScript:edit(\""+rowdata.bankAcctId+"\")'>编辑</a>"
											+"<a href=''>设为默认银行账号</a>";
									}else{
										str="<a href=''>设为默认银行账号</a>";
									}
								 	return str
	                    		}
							}
				],
				rowNum : 20,
				rowList : [ 10, 20, 30,50,100,500,1000],
				rownumbers : true,
				pager : "#gridpage",
				//multiselect: true, 
				viewrecords : true,
				caption : "银行账户列表",
				jsonReader : {
					repeatitems : false,
					id : "ids"
				}
			});
			$("#gridlist").jqGrid('navGrid', '#gridpage', {add : false,edit : false,del : false,search : false,refresh : false});
			$(window).trigger("resize");
		});
		
	   function getFoucs(obj, rowId) {
	       var text = $.trim($(obj).val());
	       if (text != null && text != "") {
	           var $checkbox = $("#jqg_gridlist_" + rowId);
	           if ($checkbox.is(":not(:checked)")) {
	               $("#gridlist").setSelection(rowId);
	           }
	       }
	   }
	   
	   //查询
	   function gridSerch() {
	       var bankAcctNo = $.trim($("#bankAcctNo").val());
	       var acctHolder = $.trim($("#acctHolder").val());
	       var depositBankName = $.trim($("#depositBankName").val());
	       var depositBankNo  = $.trim($("#depositBankNo").val());
	       $("#gridlist").jqGrid('setGridParam',{  
	    	   url:"${ctx}/acctInfoHosp/getBankAcctInfoHospData.html",
	           datatype:'json',
	           postData:{
	               "bankAcctNo":bankAcctNo,
	               "acctHolder":acctHolder,
	               "depositBankName":depositBankName,
	               "depositBankNo":depositBankNo
	           },
	           page:1
	       }).trigger("reloadGrid"); //重新载入  
	   }
	   
	   //新增银行卡
	     function add() {
	        window.location.href = "${ctx}/acctInfoHosp/toAcctInfoHospAdd.html";
	     }
	     
	   function edit(bankAcctId){
		   $("#bankAcctId").val(bankAcctId);
		   $("#BankForm").submit();
	   }
			   
	</script>
</body>
</html>